package com.dailyblue.java.standard.thread.pool;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class ThreadPoolDemoD {
    public static void main(String[] args) {
        ScheduledExecutorService service = Executors.newScheduledThreadPool(4);
        Task task = new Task(1);
        //service.schedule(task,1, TimeUnit.SECONDS);
        service.scheduleAtFixedRate(task,3,1,TimeUnit.SECONDS);
        service.shutdown();
        service.shutdownNow();
    }
}
